import { createApp } from 'vue'
// import './style.css'
import './my-style.css'
import App from './App.vue'
import 'element-plus/dist/index.css'
import ElementPlus from 'element-plus'
import { createPinia } from "pinia";


import {createRouter, createWebHistory} from 'vue-router'

import RecommendView from './components/RecommendView.vue'
import NewsView from './components/NewsView.vue'
import NewsSearchResultView from './components/NewsSearchResultView.vue'

const pinia = createPinia();

const routes = [
    { path: '/', component: RecommendView },
    { path: '/news/:newsId', component: NewsView},
    { path: '/news', redirect: '/news/100017383',  },
    { path: '/search/:keywords', component: NewsSearchResultView },
]

const router = createRouter({
    // 4. 内部提供了 history 模式的实现。为了简单起见，我们在这里使用 hash 模式。
    // history: createWebHashHistory(),
    history: createWebHistory(),
    routes, // `routes: routes` 的缩写
})
const app = createApp(App)

app.use(pinia);
app.use(router)
app.use(ElementPlus)

app.mount('#app')

// createApp(App).mount('#app')
